<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.clearfix:after,
			.clearfix:before {
				content: '';
				display: table;
			}
			
			.clearfix:after {
				clear: both;
			}
			*{
				margin: 0;
				padding: 0;
			}
			.y_cont{
				margin: 0 20px;
			}
			.y_cont img{
				width: 200px;
				height: 266px;
			}
		</style>
	</head>

	<body>
		<div class="box" style="width: 1200px;margin: auto;border: solid 1px #ccc;padding: 40px;">
			<div class="y_book_tit clearfix">
				<h3 style="font-size: 32px;line-height: 50px;margin-bottom: 20px;float: left;line-height: 70px;">我的书架</h3>
				<a href=""><button id="y_publish_btn" style="float: right;width: 70px;height: 70px;border-radius: 50%;font-size: 20px;outline: none;background: #FF6600;color: #FFF;border: none;">发布</button></a>
			</div>
			<div class="y_book_content clearfix">
			</div>
		</div>
		<script type="text/javascript" src="jquery.js"></script>
		<script type="text/javascript">
			var href='http://localhost:8000'
			var loginuid=location.href.split('?')[1].split('=')[1].split('&')[0]
			var author=location.href.split('?')[1].split('&')[1].split('=')[1]
			console.log(loginuid,author)
			$.ajax({
				type:"post",
				url:href+"/users/bookrack",
				data:{
					loginuid:loginuid
				},
				success(data){
					console.log(data)
					data.forEach(function(o,i){
						var oDiv=$('<div class="y_cont" style="width: 200px;float: left;">')
						oDiv.append($('<a>').attr('data-name',data[i].uid).append($('<img>').attr('src',data[i].novelimg)
					).append($('<p>').html(data[i].novelname)))
					$('.y_book_content').append(oDiv)
					})
				}
			});
			$('.y_book_content').on('click','a',function(){
				$(this).attr('href',href+'/xiang.html?searchuid='+$(this).attr('data-name'))
			})
			$('.y_book_tit a').on('click',function(){
				$(this).attr('href',href+'/lz.html?loginuid='+loginuid+'&author='+author)
			})
		</script>
	</body>

</html>